<?xml version="1.0" encoding="UTF-8"?>
<html filename="docs/SAX/TInputSource.html">
<body>
<a id="#top"/>
<h1>
	                Class Summary : TInputSource </h1> A single input source for an XML entity.

 <blockquote>
 <em>This module, both source code and documentation, is in the
 Public Domain, and comes with <strong>NO WARRANTY</strong>.</em>
 </blockquote>

 <p>This class allows a SAX application to encapsulate information
 about an input source in a single object, which may include
 a public identifier, a system identifier, and/or a byte stream (possibly
 with a specified encoding).</p>

 <p>There are two places that the application can deliver an
 input source to the parser: as the argument to the IParser.parse or
 IXMLReader.parse method, or as the return value of the
 IEntityResolver.resolveEntity method.</p>

 <p>The SAX parser will use the InputSource object to determine how
 to read XML input.  If there is a byte stream available, the
 parser will read that stream directly, disregarding any text
 encoding declaration found in that stream.
 If there is no character stream, but there is
 a byte stream, the parser will use that byte stream, using the
 encoding specified in the InputSource or else (if no encoding is
 specified) autodetecting the character encoding using an algorithm
 such as the one in the XML specification.  If neither a character
 stream nor a
 a byte stream is available, the parser will attempt to open a URI
 connection to the resource identified by the system
 identifier (this may be done using a TFilestream).</p>

 <p>For alternate InputSources sych as ones which implement byte streams
 see <a href="../SAX/IStreamInputSource.html">IStreamInputSource</a>. Implementors are
 encouraged to create alternate InputSources, but should be aware that
 readers must be created that support them.</p>

 <p>An InputSource object belongs to the application: the SAX parser
 shall never modify it in any way (it may modify a copy if
 necessary). However, standard processing of both byte and
 character streams is to close them as part of end-of-parse cleanup,
 which means that the stream will be freed.
 Applications should not attempt to re-use such streams after they
 have been handed to a parser.</p>

<br/><b>Since : </b> SAX 1.0
<br/><b>See : </b> <a href="../SAX/IXMLReader.html#parse.IInputSource">IXMLReader.parse(IInputSource)</a>
<br/><b>See : </b> <a href="../SAX/IEntityResolver.html#resolveEntity">IEntityResolver.resolveEntity</a>
<h2>
	              Methods
	            </h2>
<div style="padding-left:10px">
<a href="#setPublicId">
	                  procedure
	                 setPublicId(SAXString)</a>
<br/>
<a href="#getPublicId">
	                  function
	                 getPublicId() : SAXString</a>
<br/>
<a href="#setSystemId">
	                  procedure
	                 setSystemId(SAXString)</a>
<br/>
<a href="#getSystemId">
	                  function
	                 getSystemId() : SAXString</a>
<br/>
<a href="#setEncoding">
	                  procedure
	                 setEncoding(SAXString)</a>
<br/>
<a href="#getEncoding">
	                  function
	                 getEncoding() : SAXString</a>
<br/>
</div>
<br/>
<hr width="100%"/>
<a name="#setPublicId">
<p>
<b>procedure</b> setPublicId(<b>const</b> publicId : SAXString); </p>
</a> Set the public identifier for this input source.

 <p>The public identifier is always optional: if the application
 writer includes one, it will be provided as part of the
 location information.</p>

<br/><b>Parameter : </b> publicId The public identifier as a string.
<br/><b>See : </b> <a href="../SAX/TInputSource.html#getPublicId">TInputSource.getPublicId</a>
<br/><b>See : </b> <a href="../SAX/ILocator.html#getPublicId">ILocator.getPublicId</a>
<br/><b>See : </b> <a href="../SAX/ESAXParseException.html#getPublicId">ESAXParseException.getPublicId</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getPublicId">
<p>
<b>function</b> getPublicId() : SAXString; </p>
</a> Get the public identifier for this input source.

<br/><b>Result : </b> The public identifier, or an empty string if none was supplied.
<br/><b>See : </b> <a href="../SAX/TInputSource.html#setPublicId">TInputSource.setPublicId</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#setSystemId">
<p>
<b>procedure</b> setSystemId(<b>const</b> systemId : SAXString); </p>
</a> Set the system identifier for this input source.

 <p>The system identifier is optional if there is a byte stream
 or a character stream, but it is still useful to provide one,
 since the application can use it to resolve relative URIs
 and can include it in error messages and warnings (the parser
 will attempt to open a connection to the URI only if
 there is no byte stream specified).</p>

 <p>If the application knows the character encoding of the
 object pointed to by the system identifier, it can register
 the encoding using the setEncoding method.</p>

 <p>If the system identifier is a URL, it must be fully
 resolved (it may not be a relative URL).</p>

<br/><b>Parameter : </b> systemId The system identifier as a string.
<br/><b>See : </b> <a href="../SAX/TInputSource.html#setEncoding">TInputSource.setEncoding</a>
<br/><b>See : </b> <a href="../SAX/TInputSource.html#getSystemId">TInputSource.getSystemId</a>
<br/><b>See : </b> <a href="../SAX/ILocator.html#getSystemId">ILocator.getSystemId</a>
<br/><b>See : </b> <a href="../SAX/ESAXParseException.html#getSystemId">ESAXParseException.getSystemId</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getSystemId">
<p>
<b>function</b> getSystemId() : SAXString; </p>
</a> Get the system identifier for this input source.

 <p>The getEncoding method will return the character encoding
 of the object pointed to, or an empty string if unknown.</p>

 <p>If the system ID is a URL, it will be fully resolved.</p>

<br/><b>Result : </b> The system identifier, or a blank string if none was supplied.
<br/><b>See : </b> <a href="../SAX/TInputSource.html#setSystemId">TInputSource.setSystemId</a>
<br/><b>See : </b> <a href="../SAX/TInputSource.html#getEncoding">TInputSource.getEncoding</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#setEncoding">
<p>
<b>procedure</b> setEncoding(<b>const</b> encoding : SAXString); </p>
</a> Set the character encoding, if known.

 <p>The encoding must be a string acceptable for an
 XML encoding declaration (see section 4.3.3 of the XML 1.0
 recommendation).</p>

<br/><b>Parameter : </b> encoding A string describing the character encoding.
<br/><b>See : </b> <a href="../SAX/TInputSource.html#setSystemId">TInputSource.setSystemId</a>
<br/><b>See : </b> <a href="../SAX/TInputSource.html#setByteStream">TInputSource.setByteStream</a>
<br/><b>See : </b> <a href="../SAX/TInputSource.html#getEncoding">TInputSource.getEncoding</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
<hr width="100%"/>
<a name="#getEncoding">
<p>
<b>function</b> getEncoding() : SAXString; </p>
</a> Get the character encoding for a byte stream or URI.

<br/><b>Result : </b> The encoding, or an empty string if none was supplied.
<br/><b>See : </b> <a href="../SAX/TInputSource.html#setByteStream">TInputSource.setByteStream</a>
<br/><b>See : </b> <a href="../SAX/TInputSource.html#getSystemId">TInputSource.getSystemId</a>
<br/><b>See : </b> <a href="../SAX/TInputSource.html#getByteStream">TInputSource.getByteStream</a>
<br/>
<p>
<a href="#top">Top</a>
</p>
</body>
</html>